﻿using System;
using System.Windows.Markup;
using Petra.Gis.Geometry.Support;
using Petra.Gis.ReferenceSystemServices;
using Petra.Gis.ReferenceSystemServices.Transformations;


namespace testDocumentServices
{
  public class xamlTest
  {

    public static void testMe()
    {

      //string tr = "sdsd";

      string tr = @"
<KrovakProjection xmlns='clr-namespace:Petra.Gis.ReferenceSystemServices.Transformations;assembly=Petra.Gis.ReferenceSystemServices.Transformations' xmlns:pgrss='clr-namespace:Petra.Gis.ReferenceSystemServices;assembly=Petra.Gis.ReferenceSystems' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:s='clr-namespace:System;assembly=mscorlib' xmlns:pggs='clr-namespace:Petra.Gis.Geometry.Support;assembly=Petra.Gis.Geometry'>

  <KrovakProjection.Source>
    <pgrss:ProjectedCoordinateSystem>
      <pgrss:ProjectedCoordinateSystem.GeographicCoordinateSystem>
        <pgrss:GeographicCoordinateSystem>
          <pgrss:GeographicCoordinateSystem.PrimeMeridian>
            <pgrss:PrimeMeridian Longitude='-17.4'>
              <pgrss:PrimeMeridian.AngularUnit>
                <pgrss:AngularUnit RadiansPerUnit='0.017453292519943295' />
              </pgrss:PrimeMeridian.AngularUnit>
            </pgrss:PrimeMeridian>
          </pgrss:GeographicCoordinateSystem.PrimeMeridian>
          <pgrss:GeographicCoordinateSystem.Datum>
            <pgrss:HorizontalDatum>
              <pgrss:HorizontalDatum.Ellipsoid>
                <pgrss:Spheroid SemiMajorAxis='6377397.155' SemiMinorAxis='6356078.96284'>
                  <pgrss:Spheroid.AxisUnit>
                    <pgrss:DistanceUnit MetersPerUnit='1' />
                  </pgrss:Spheroid.AxisUnit>
                </pgrss:Spheroid>
              </pgrss:HorizontalDatum.Ellipsoid>
            </pgrss:HorizontalDatum>
          </pgrss:GeographicCoordinateSystem.Datum>
          <pgrss:GeographicCoordinateSystem.Axes>
            <pgrss:AxisList Capacity='4'>
              <pgrss:Axis Name='E' Orientation='East' />
              <pgrss:Axis Name='N' Orientation='North' />
            </pgrss:AxisList>
          </pgrss:GeographicCoordinateSystem.Axes>
        </pgrss:GeographicCoordinateSystem>
      </pgrss:ProjectedCoordinateSystem.GeographicCoordinateSystem>
      <pgrss:ProjectedCoordinateSystem.Projection>
        <pgrss:Projection ClassName='Krovak'>
        </pgrss:Projection>
      </pgrss:ProjectedCoordinateSystem.Projection>
      <pgrss:ProjectedCoordinateSystem.VerticalDatum>
        <pgrss:VerticalDatum Type='Unspecified'>
          <pgrss:VerticalDatum.VerticalUnit>
            <pgrss:DistanceUnit MetersPerUnit='1' />
          </pgrss:VerticalDatum.VerticalUnit>
        </pgrss:VerticalDatum>
      </pgrss:ProjectedCoordinateSystem.VerticalDatum>
      <pgrss:ProjectedCoordinateSystem.Axes>
        <pgrss:AxisList Capacity='4'>
          <pgrss:Axis Name='X' Orientation='South' />
          <pgrss:Axis Name='Y' Orientation='West' />
        </pgrss:AxisList>
      </pgrss:ProjectedCoordinateSystem.Axes>
      <pgrss:ProjectedCoordinateSystem.DefaultEnvelope>
        <pggs:BoundingBox Left='431680' Right='904554' Top='1227672' Bottom='935198' />
      </pgrss:ProjectedCoordinateSystem.DefaultEnvelope>
      <pgrss:ProjectedCoordinateSystem.Unit>
        <pgrss:DistanceUnit MetersPerUnit='1' />
      </pgrss:ProjectedCoordinateSystem.Unit>
    </pgrss:ProjectedCoordinateSystem>
  </KrovakProjection.Source>
  <KrovakProjection.Target>
    <pgrss:GeographicCoordinateSystem>
      <pgrss:GeographicCoordinateSystem.PrimeMeridian>
        <pgrss:PrimeMeridian Longitude='-17.4'>
          <pgrss:PrimeMeridian.AngularUnit>
            <pgrss:AngularUnit RadiansPerUnit='0.017453292519943295' />
          </pgrss:PrimeMeridian.AngularUnit>
        </pgrss:PrimeMeridian>
      </pgrss:GeographicCoordinateSystem.PrimeMeridian>
      <pgrss:GeographicCoordinateSystem.Datum>
        <pgrss:HorizontalDatum>
          <pgrss:HorizontalDatum.Ellipsoid>
            <pgrss:Spheroid SemiMajorAxis='6377397.155' SemiMinorAxis='6356078.96284'>
              <pgrss:Spheroid.AxisUnit>
                <pgrss:DistanceUnit MetersPerUnit='1' />
              </pgrss:Spheroid.AxisUnit>
            </pgrss:Spheroid>
          </pgrss:HorizontalDatum.Ellipsoid>
        </pgrss:HorizontalDatum>
      </pgrss:GeographicCoordinateSystem.Datum>
      <pgrss:GeographicCoordinateSystem.Axes>
        <pgrss:AxisList Capacity='4'>
          <pgrss:Axis Name='E' Orientation='East' />
          <pgrss:Axis Name='N' Orientation='North' />
        </pgrss:AxisList>
      </pgrss:GeographicCoordinateSystem.Axes>
    </pgrss:GeographicCoordinateSystem>
  </KrovakProjection.Target>

</KrovakProjection>
      ";

      SRSTransform c1 = (SRSTransform)XamlReader.Parse(tr);


    }

  }
}
